﻿using System;
using System.ComponentModel;
using System.Runtime.InteropServices;

namespace Teigha.Core
{
	public class OdGsModelReactor : IDisposable
	{
		[EditorBrowsable(EditorBrowsableState.Never)]
		public OdGsModelReactor(IntPtr cPtr, bool cMemoryOwn)
		{
			this.swigCMemOwn = cMemoryOwn;
			this.swigCPtr = new HandleRef(this, cPtr);
		}

		[EditorBrowsable(EditorBrowsableState.Never)]
		public static HandleRef getCPtr(OdGsModelReactor obj)
		{
			if (obj != null)
			{
				return obj.swigCPtr;
			}
			return new HandleRef(null, IntPtr.Zero);
		}

		~OdGsModelReactor()
		{
			this.Dispose();
		}

		public virtual void Dispose()
		{
			if (this.swigCPtr.Handle != IntPtr.Zero)
			{
				if (this.swigCMemOwn)
				{
					lock (this.locker)
					{
						if (this.swigCPtr.Handle != IntPtr.Zero && this.swigCMemOwn)
						{
							this.swigCMemOwn = false;
							GlobalsPINVOKE.delete_OdGsModelReactor(this.swigCPtr);
						}
					}
					this.swigCMemOwn = false;
				}
				this.swigCPtr = new HandleRef(null, IntPtr.Zero);
			}
			GC.SuppressFinalize(this);
		}

		public OdGsModelReactor() : this(GlobalsPINVOKE.new_OdGsModelReactor(), true)
		{
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public virtual bool onAdded(OdGsModel pModel, OdGiDrawable pAdded, OdGiDrawable pParent)
		{
			bool result = GlobalsPINVOKE.OdGsModelReactor_onAdded__SWIG_0(this.swigCPtr, OdGsModel.getCPtr(pModel), OdGiDrawable.getCPtr(pAdded), OdGiDrawable.getCPtr(pParent));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual bool onAdded(OdGsModel pModel, OdGiDrawable pAdded, OdDbStub parentID)
		{
			bool result = GlobalsPINVOKE.OdGsModelReactor_onAdded__SWIG_1(this.swigCPtr, OdGsModel.getCPtr(pModel), OdGiDrawable.getCPtr(pAdded), OdDbStub.getCPtr(parentID));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual bool onErased(OdGsModel pModel, OdGiDrawable pErased, OdGiDrawable pParent)
		{
			bool result = GlobalsPINVOKE.OdGsModelReactor_onErased__SWIG_0(this.swigCPtr, OdGsModel.getCPtr(pModel), OdGiDrawable.getCPtr(pErased), OdGiDrawable.getCPtr(pParent));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual bool onErased(OdGsModel pModel, OdGiDrawable pErased, OdDbStub parentID)
		{
			bool result = GlobalsPINVOKE.OdGsModelReactor_onErased__SWIG_1(this.swigCPtr, OdGsModel.getCPtr(pModel), OdGiDrawable.getCPtr(pErased), OdDbStub.getCPtr(parentID));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual bool onModified(OdGsModel pModel, OdGiDrawable pModified, OdGiDrawable pParent)
		{
			bool result = GlobalsPINVOKE.OdGsModelReactor_onModified__SWIG_0(this.swigCPtr, OdGsModel.getCPtr(pModel), OdGiDrawable.getCPtr(pModified), OdGiDrawable.getCPtr(pParent));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual bool onModified(OdGsModel pModel, OdGiDrawable pModified, OdDbStub parentID)
		{
			bool result = GlobalsPINVOKE.OdGsModelReactor_onModified__SWIG_1(this.swigCPtr, OdGsModel.getCPtr(pModel), OdGiDrawable.getCPtr(pModified), OdDbStub.getCPtr(parentID));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual bool onHighlight(OdGsModel pModel, OdGiPathNode path, bool bDoIt, OdGsView pView)
		{
			bool result = GlobalsPINVOKE.OdGsModelReactor_onHighlight(this.swigCPtr, OdGsModel.getCPtr(pModel), OdGiPathNode.getCPtr(path), bDoIt, OdGsView.getCPtr(pView));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		private object locker = new object();

		private HandleRef swigCPtr;

		protected bool swigCMemOwn;
	}
}
